package top.greatxiaozou.factorPattern;

public class ShapeFactor {
    Shape getShape(String shape) {
        if (shape.equals("circle")) {
            return new Circle();

        } else if (shape.equals("rectangel")) {
            return new Rectangel();

        } else if (shape.equals("square")) {
            return new Square();

        } else {
            return null;
        }
    }
}
